/**
 * 
 */
package gsm.cable.server.module.user;

import gsm.cable.server.module.Address;

import java.util.HashSet;
import java.util.Set;

/**
 * @author acer
 * 
 */
public abstract class AbsUser implements User_ {

	private String name;

	private String father_name;

	private Set<String> roles;

	private Address address;

	private String password;

	private String email_id;

	private String mobile_no;

	@Override
	public String getName() {
		return name;
	}

	@Override
	public String getFatherName() {
		return father_name;
	}

	@Override
	public Set<String> getRoles() {
		return roles;
	}

	@Override
	public Address getAddreess() {
		return address;
	}

	@Override
	public String getPassword() {
		return password;
	}

	@Override
	public String getEmailId() {
		return email_id;
	}

	@Override
	public void setName(String name) {
		this.name = name;
	}

	@Override
	public void setFatherName(String fatherName) {
		this.father_name = fatherName;
	}

	@Override
	public void setRoles(String... role) {
		int length = role == null ? 0 : role.length;
		if (length > 0 && roles == null) {
			roles = new HashSet<String>();
		}
		for (int index = 0; index < length; index++) {
			roles.add(role[index]);
		}
	}

	@Override
	public void setAddress(Address address) {
		this.address = address;
	}

	@Override
	public void setPassword(String password) {
		this.password = password;
	}

	@Override
	public void setEmailId(String email) {
		this.email_id = email;

	}

	@Override
	public void setMobileNo(String mobileNumber) {
		this.mobile_no = mobileNumber;
	}

	@Override
	public String getMobileNo() {
		return mobile_no;
	}

}
